package June;
import java.util.Scanner;
public class MulForExercise01 {
    public static void main(String[] args) {
        // 统计3个班成绩情况，
        // 每个班有5名同学，
        // 求出各个班的平均分
        // 所有班级的平均分[学生的成绩从键盘输入]。
        // 统计三个班及格人数，每个班有5名同学。
        Scanner myscanner = new Scanner(System.in);
        double sum_all = 0;
        int count = 0;
        //循环出3个班级
        for (int clAss = 1; clAss <= 3; clAss++){
            double sum_class = 0;
            //每个班5名同学
            for (int student = 1; student <= 5; student++) {
                System.out.print("请输入第" + clAss + "个班级 第" + student + "个同学的成绩：");
                double score = myscanner.nextDouble();
                sum_class += score;
                if (score >= 60) {
                    count++;
                }
            }
            sum_all += sum_class;
            System.out.println("第" + clAss + "个班级的平均分是：" + (sum_class / 5));
        }
        System.out.println("所有班级的平均分是：" + (sum_all / 15));
        System.out.println("三个班及格人数有：" + count);

    }
}
